import axios from 'axios'

const service = axios.create({
  baseURL: '/',
  timeout: 6000
})
service.interceptors.request.use(
  config => {
    config.params = {
      appkey: 'xxxxx', // 京东的key
      ...config.params
    }
    return config
  },
  error => {
    console.log(error)
    return Promise.reject(error)
  }
)
service.interceptors.response.use(
  response => {
    return response
  },
  error => {
    console.log(error)
    return Promise.reject(error)
  }
)

export default service
